package br.ufpr.showdomilhao;

import java.text.DecimalFormat;
import java.text.NumberFormat;

import br.ufpr.showdomilhao.control.PartidaControl;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

public class FimJogoActivity extends Activity {
	
	// fields
	private PartidaControl partidaControl = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_fim_jogo);
		Bundle params = getIntent().getExtras();
		
		
		TextView txtMensagem = ((TextView) findViewById(R.id.txtMensagem));
		txtMensagem.setText(params.getString("mensagem"));
		
		NumberFormat df = new DecimalFormat("#,##0.00");  
		TextView txtValorGanho = ((TextView) findViewById(R.id.txtValorGanho));
		txtValorGanho.setText("R$ " + df.format(params.getDouble("valor")));
		
	}

	// public methods
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.fim_jogo, menu);
		return true;
	}
	public void onClickInicio(View view) {
		Intent i = new Intent(this, MainActivity.class);
		startActivity(i);
	}

}
